using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       LSPassport_Verify_FailedReciever.cs
*@brief      process message LSPassport_Verify_Failed
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/21
*/

//process LSPassport_Verify_Failed
public class OnLSPassport_Verify_Failed
{
    /// <summary>
    /// process message
    /// </summary>
    /// <param name="op">message operator</param>
    /// <param name="session_id">session identifier</param>
    /// <param name="msg_buffer">message buffer</param>
    /// <param name="msg_bytes">buffer length</param>
    public static void OnMapping(IMessageOperator op, Int32 session_id, byte[] msg_buffer, UInt32 msg_bytes)
    {
        //TODO
		loginserver.PassportVerifyFailed pvf = ProtoNet<loginserver.PassportVerifyFailed>.CreateFromBytes(msg_buffer, msg_bytes);
        UsrInfoCacheUnit ucu = op.UsrInfo.GetByGateCode(pvf.GateCode);
        if (ucu != null)
        {
            msgGWUser_Enter_Failed enter_failed = new msgGWUser_Enter_Failed(ucu.SessionId, pvf.ErrorCode);
            gwMessagePort.ProcessMessage(enter_failed);
        }
    }
}

//register callback
partial class MessageProcTypes<ProcType, MessageProc>
{
        [MessageProcType((int)LoginServerTypes.MessageType.LSPassport_Verify_Failed)]
        public static LoginServerProcessor.LoginServerTabFunc LSPassport_Verify_FailedProc = new LoginServerProcessor.LoginServerTabFunc(OnLSPassport_Verify_Failed.OnMapping);
}
